﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchService.aspx.cs"
    Inherits="TKDVQ10.Search.SearchService" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="~/Search/GoogleMapForASPNet.ascx" TagName="GoogleMapForASPNet"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Tim Kiem Dich Vu Quan 10 TP HCM</title>
    <link href="App_Themes/Default/style.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Default/Grid.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        *.x-btn
        {
            font: normal 11.0 tahoma , verdana , helvetica;
        }
        *.x-btn button
        {
            font: normal 11.0 arial , tahoma , verdana , helvetica;
            background-image: url(../App_Themes/Default/Images/search_white.png);
            background-repeat: no-repeat;
            background-position: center;
            width: 50px;
            background-color: #4D90FE;
        }
        .button
        {
            font: normal 11.0 arial , tahoma , verdana , helvetica;
            background-image: url(../App_Themes/Default/Images/search_white.png);
            background-repeat: no-repeat;
            background-position: center;
            width: 50px;
            background-color: #4D90FE;
        }
        *.x-btn-tl, *.x-btn-tr, *.x-btn-tc, *.x-btn-mc, *.x-btn-bl, *.x-btn-br, *.x-btn-bc, .x-btn-small, .x-btn-icon-small-left
        {
            background-color: #4D90FE;
            cursor: pointer;
            padding: 0 5px;
            text-align: center;
            vertical-align: middle;
            white-space: nowrap;
        }
        .x-grid3-td-fullName .x-grid3-cell-inner
        {
            font-family: tahoma, verdana;
            display: block;
            font-weight: normal;
            font-style: normal;
            color: #385F95;
            white-space: normal;
        }
        .x-grid3-row-body p
        {
            margin: 5px 5px 10px 5px !important;
            width: 99%;
            color: Gray;
        }
        .search-item
        {
            font: normal 11px tahoma, arial, helvetica, sans-serif;
            padding: 3px 10px 3px 10px;
            border: 1px solid #fff;
            border-bottom: 1px solid #eeeeee;
            white-space: normal;
            color: #555;
        }
        .search-item h3
        {
            display: block;
            font: inherit;
            font-weight: bold;
            color: #222;
        }
        .search-item h3 span
        {
            float: right;
            font-weight: normal;
            margin: 0 0 5px 5px;
            width: 100px;
            display: block;
            clear: none;
        }
        p
        {
            width: 650px;
        }
        .ext-ie .x-form-text
        {
            position: static !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <ext:ResourceManager ID="ResourceManager1" runat="server">
    </ext:ResourceManager>
    <div id="container">
        <div id="banner">
            <img src="App_Themes/Default/Images/Untitled-1.jpg" />
        </div>
        
        <div style="width: 100%; min-height: 400px">
            <div id="left">
                <ext:FormPanel runat="server" ID="pnlMain" Height="80" Border="false" Width="490">
                    <Items>
                        <ext:FormPanel ID="pnl" runat="server" Flex="1" Layout="AnchorLayout" MinWidth="490"
                            Height="80" Border="false" ButtonAlign="Left">
                            <Items>
                                <ext:Panel ID="Navigation" runat="server" Border="false" AutoHeight="true" Padding="20"
                                    Height="80" Title="Search Services">
                                    <Items>
                                        <ext:ComboBox ID="cbTuKhoa" runat="server" DisplayField="Keyword" ValueField="Keyword" EmptyText="Enter your text"
                                            TypeAhead="false" LoadingText="Searching..." Width="250" HideTrigger="true" ItemSelector="div.search-item"
                                             ForceSelection="false" StyleSpec="margin-left:10px;" Editable="true" MinChars="2" SelectOnFocus="true" DisableKeyFilter="true" EnableKeyEvents="true" >
                                            <Store>
                                                <ext:Store ID="StoreTuKhoa" runat="server" AutoLoad="false">
                                                    <Proxy>
                                                        <ext:HttpProxy Method="GET" Url="~/Keyword/KeywordHandler.ashx" />
                                                    </Proxy>
                                                    <Reader>
                                                        <ext:JsonReader Root="keywords" TotalProperty="total">
                                                            <Fields>
                                                                <ext:RecordField Name="Keyword" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                </ext:Store>
                                            </Store>
                                            <Template ID="Template1" runat="server">
                                                <Html>
                                                <tpl for=".">
						  <div class="search-item">
							 <h3>{Keyword}</h3>
						  </div>
					   </tpl>
                                                </Html>
                                            </Template>
                                            
                                            <Listeners>
                                            <Change Handler="this.focus();" />
                                            </Listeners>
                                            <%--<DirectEvents>
                                                <Change OnEvent="cbTuKhoa_Changed">
                                                    <EventMask ShowMask="true" />
                                                </Change>
                                            </DirectEvents>--%>
                                        </ext:ComboBox>
                                       <%-- <ext:Panel ID="pnlCtrl" runat="server" Border="false" Height="30" Width="70" StyleSpec="margin-top:5px; margin-left:10px;">
                                            <Defaults>
                                                <ext:Parameter Name="margins" Value="5 5 0 5" Mode="Value" />
                                                <ext:Parameter Name="width" Value="70" Mode="Value" />
                                            </Defaults>
                                            <Items>
                                                <ext:Button ID="btnSearch" runat="server" Width="50" Height="30">
                                                    <DirectEvents>
                                                        <Click OnEvent="btnSearch_Clicked">
                                                            <EventMask ShowMask="true" />
                                                        </Click>
                                                    </DirectEvents>
                                                </ext:Button>
                                            </Items>
                                        </ext:Panel>--%>
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:FormPanel>
                    </Items>
                </ext:FormPanel>
     
                <asp:Button ID="btnSearch" runat="server" CssClass="T-I J-J5-Ji T-I-atl" Width="70" OnClick="btnSearch_Clicked"  />
              <div class="gridContainer" style="margin-top:10px">
               <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="grdResults" runat="server" AutoGenerateColumns="false"  Width="490">
                            <Columns>
                                <asp:TemplateField HeaderText="Your Results" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="search-item">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbtnDiaChi" runat="server" Text='<%#Bind("DiaChi")%>' CommandArgument='<%# Container.DataItemIndex %>'   
                                            OnClick="lbtnDiaChi_Clicked"></asp:LinkButton>
                                        <asp:HiddenField ID="hidKinhDo" runat="server" Value='<%#Bind("KinhDo")%>' />
                                        <asp:HiddenField ID="hidViDo" runat="server" Value='<%#Bind("ViDo")%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
                </div>
                <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                   <ext:GridPanel ID="grdResult" runat="server" Border="false" AutoHeight="true" HideHeaders="true"
                                            BodyBorder="false" MinWidth="490">
                                            <Store>
                                                <ext:Store ID="StoreDiaDiem" runat="server">
                                                    <Reader>
                                                        <ext:JsonReader IDProperty="MaDuLieu">
                                                            <Fields>
                                                                <ext:RecordField Name="MaDuLieu" Type="Int" />
                                                                <ext:RecordField Name="DiaChi" />
                                                                <ext:RecordField Name="KinhDo" />
                                                                <ext:RecordField Name="ViDo" />
                                                                <ext:RecordField Name="ChuThich" AllowBlank="true" UseNull="false" Type="String" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                </ext:Store>
                                            </Store>
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                
                                                    <ext:Column ColumnID="DiaChi" DataIndex="DiaChi" Wrap="true" Width="490">
                                                    </ext:Column>
                                                </Columns>
                                            </ColumnModel>
                                            <View>
                                                <ext:GridView ID="GridView1" runat="server" EnableRowBody="true">
                                                    <GetRowClass Handler="rowParams.body = '<p>' +record.data.ChuThich + '</p>'; return 'x-grid3-row-expanded';" />
                                                </ext:GridView>
                                            </View>
                                            <SelectionModel >
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" AutoDataBind="true">
                                                    <DirectEvents>
                                                    
                                                        <RowSelect OnEvent="RowSelect" Buffer="100"  >
                                                            <EventMask ShowMask="true" />
                                                            <ExtraParams>
                                                              
                                                                <ext:Parameter Name="MaDuLieu" Value="this.getSelected().data.MaDuLieu" Mode="Raw" />
                                                                 <ext:Parameter Name="DiaChi" Value="this.getSelected().data.DiaChi" Mode="Raw" />
                                                                  <ext:Parameter Name="KinhDo" Value="this.getSelected().data.KinhDo" Mode="Raw" />
                                                                   <ext:Parameter Name="ViDo" Value="this.getSelected().data.ViDo" Mode="Raw" />
                                                            </ExtraParams>
                                                            
                                                        </RowSelect>
                                                    </DirectEvents>
                                                </ext:RowSelectionModel>
                                            </SelectionModel>
                                            <LoadMask ShowMask ="true" />
                                        </ext:GridPanel>
                </ContentTemplate>
                </asp:UpdatePanel>--%>
            </div>
            <div id="right">
                <uc1:GoogleMapForASPNet ID="GoogleMapForASPNet1" runat="server" />
                
               
            </div>
        </div>
         <div class="footer">
         <ext:Panel runat="server" Title="Developed by 10 Group of Natural Science University HCM City" Width="1200" Height="20" ></ext:Panel>
         </div> 
    </div>
    </form>

    <script language="javascript" type="text/javascript">
//function endRequestHandler(sender, args)
//{
//try    {

//        DrawGoogleMap();
//    }
//    catch(err)
//    {
//    }
//}
//function pageLoad()
//{
//    if(!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
//        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
//}
    </script>

</body>
</html>
